package com.ibeeking.found.open.b.rest.controller.v1;

import com.ibeeking.found.open.b.rest.service.IMemberService;
import com.ibeeking.found.open.service.common.dto.MemberCouponListDTO;
import com.ibeeking.found.open.service.common.dto.MemberInfoDTO;
import com.ibeeking.found.open.service.common.query.MemberCouponQuery;
import com.ibeeking.found.open.service.common.query.MemberInfoQuery;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import com.ibeeking.nematos.utils.base.page.Page;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName MemberController控制器
 * @Description
 * @Author ibeeking
 * @Date 2021-06-02 18:15
 **/
@RestController
@RequestMapping("/v1/api/member")
public class MemberController {

    @Resource
    private IMemberService memberServiceImpl;

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "会员信息查询")
    @PostMapping(value = "/info")
    public MemberInfoDTO memberInfo(@RequestBody MemberInfoQuery query) {
        return memberServiceImpl.memberInfo(query);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "会员券列表查询")
    @PostMapping(value = "/couponList")
    public Page<MemberCouponListDTO> memberCouponList(@RequestBody MemberCouponQuery query) {
        return memberServiceImpl.memberCouponList(query);
    }
}
